package com.test.order;

/**
 * @author RenGaoshuai
 * @date 2024/6/3 19:59
 * @description
 */
public class Son{
//public class Son  extends Father{

    public String name;

    //类加载的时候执行一次，跟创建对象没关系，跟类有关系
    static {
        System.out.println("this is Son static code");
    }


    //每执行构造方法之前执行一次，实际用途，用于提取多个构造方法中的重复代码的
    {
        System.out.println("this is Son public code1");
    }

    public Son() {
        System.out.println("this is Son Construction method");
    }
    public Son(String name) {
        this.name = name;
        System.out.println("this is Son Construction method2");
    }

    {
        System.out.println("this is Son public code2");
    }
}
